print('Введите скобки')
a=input()
b='(),[].{},<>'
s=''
for el in a:
    if el in b:
        s+=el
while '()' in s or '[]' in s or '{}' in s or'<>' in s:
    s=s.replace('()','')
    s=s.replace('[]','')
    s=s.replace('{}','')
    s=s.replace('<>','')
    if s=='':
        print('True')
    else:
        print('False')